/**
 * 玩家
 */
var Player = cc.Class({
    extends: cc.Component,

    properties: {
        anim: cc.Animation,
        body: cc.RigidBody,
        _groundTag: false,
        _space: false,//是否在空中 
    },

    onLoad: function () {

        // PlayerStates.inicializeStates();//初始化状态
    },

    isGround: function () {
        return this._groundTag;
    },

    setGround: function (bool) {
        this._groundTag = bool
    },

    setSpace: function (bool) {
        this._space = bool
    },

    getSpace: function () {
        return this._space;
    },




    onPostSolve: function (contact, selfCollider, otherCollider) {
        this.setGround(true)
    },


    playAn: function (anName, time) {

        var state = this.anim.getAnimationState(anName);
        var tag = state.isPlaying;
        if (anName == PlayerStates.PlayerAnimaEnemu.XSHOOT) {
            if (tag) {
                this.anim.play(anName, time);
            } else {
                this.anim.play(anName);
            }
            return;
        }
        if (tag) {
            return;
        }
        this.anim.play(anName);
    },


    stopAn: function (anName) {
        this.anim.stop(anName);
    },

    move: function (value) {

    },

    del: function () {
        // GameEvent.delCmd(GameEvent.PLAYER_EVENT,this.onPlayerEvent,this)
    },


    // onPlayerEvent:function(evt){
    //     let data = evt.getUserData();
    //     cc.log(".....洛克人事件....",data);
    // },



});


module.export = Player;